home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- IMPLEMENT_DYNCREATE(CBlasterDoc, CDocument)
-
- BEGIN_MESSAGE_MAP(CBlasterDoc, CDocument)
- //{{AFX_MSG_MAP(CBlasterDoc)
- ON_COMMAND(ID_FILE_SAVE, OnFileSave)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- CBlasterDoc::CBlasterDoc()
- {
- }
-
- CBlasterDoc::~CBlasterDoc()
- {
- }
-
- BOOL CBlasterDoc::OnNewDocument()
- {
- CWaitCursor wait;
-
- if (!CDocument::OnNewDocument())
- {
- generate_random = FALSE;
-
- return FALSE;
- }
-
- init_game_loop();
-
- if (generate_random)
- make_level();
-
- generate_random = FALSE;
-
- return TRUE;
- }
-
- void CBlasterDoc::Serialize(CArchive &ar)
- {
- CWaitCursor wait;
-
- if (ar.IsStoring())
- {
- save_level(ar.GetFile());
- }
- else
- {
- init_game_loop();
-
- load_level(ar.GetFile());
- }
- }
-
- #ifdef _DEBUG
- void CBlasterDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CBlasterDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif
-
- void CBlasterDoc::DeleteContents()
- {
- deinit_game_loop();
-
- CDocument::DeleteContents();
- }
-